//
//  EmojiView.swift
//  SwiftUI_App
//
//  Created by qingzhou on 2021/6/4.
//

import SwiftUI

struct EmojiView: View {
    
    let item: String
    
    @EnvironmentObject var stateManager: StateManager
    
    var body: some View {
        VStack(spacing: 30) {
            Text(item)
                .font(.system(size: 120))
                .frame(maxWidth: .infinity, maxHeight: .infinity)
                .background(Color.pink)
            
            Button(action:{}){
                Text("回到根目录")
            }
            Button(action:{
                stateManager.goToFirstRootView()
//                stateManager.firstDetailsShow = false
//                stateManager.selectedItem = nil
            }){
                Text("回到上一步")
            }
        }
    }
}

struct EmojiView_Previews: PreviewProvider {
    static var previews: some View {
        EmojiView(item: "😈")
            .environmentObject(StateManager())
    }
}
